import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import {
  combineReducers, createStore, compose, applyMiddleware,
} from 'redux';
import { Provider } from 'react-redux';
import reduxPromise from 'redux-promise';
import { jsonformsReducer } from '@jsonforms/core';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import reducers from './reducers';

// eslint-disable-next-line
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
  combineReducers({ jsonforms: jsonformsReducer() }),
  reducers,
  composeEnhancers(applyMiddleware(reduxPromise)),
);
// Actions.init({});
ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  /* eslint-disable-next-line */
  document.getElementById('root'),
);
registerServiceWorker();
